package top.eggcode.system.modules.user.service;

import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import top.eggcode.common.base.BaseMarkServiceImpl;
import top.eggcode.common.model.ListPage;
import top.eggcode.system.modules.user.model.PowerEntity;
import top.eggcode.system.modules.user.model.PowerQuery;
import top.eggcode.system.modules.user.store.PowerRepository;
import top.eggcode.system.modules.user.store.PowerStore;

import java.util.List;

/**
 * Title:
 * Description: TODO
 * Date: 2021/4/12 14:32
 *
 * @author JiaQi Ding
 * @version 1.0
 */
@Slf4j
@Transactional(rollbackFor = Exception.class)
@AllArgsConstructor
@Service
public class PowerServiceImpl extends BaseMarkServiceImpl<PowerEntity> {

    private final PowerRepository selfRepository;

    private final PowerStore selfAccessor;

    public List<PowerEntity> queryMenuList() {
        return selfRepository.selectMenuList();
    }

    @GetMapping("/list/page")
    public ListPage<PowerEntity> page(PowerQuery query) {
        return selfAccessor.page(query);
    }
}
